cmake_minimum_required(VERSION 3.10)
project(libjrpc C)

# 设置C标准
set(CMAKE_C_STANDARD 99)
set(CJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/deps)

# 创建静态库
add_library(jrpc STATIC
    jrpc.c
    deps/cjson/cJSON.c
)

# 设置库的包含目录
target_include_directories(jrpc PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CJSON_INCLUDE_DIR}
)

# 添加示例目录
add_subdirectory(example)